<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><{$site_title}>管理中心</title>
<{include file="js.html"}>

</head>

<body>
<div class="box">
<div style="background:url(images/mainbj.jpg) repeat-x; line-height:31px; height:31px; ">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td width="41" align="center">
<img src="images/biao1.jpg" /></td>
<td><strong>当前位置</strong>：管理 &gt; 列表</td>
</tr></table>
</div>

<form action="" method="post">
<table class="lefttab" cellpadding="0" cellspacing="0">
<tbody>
<tr><td colspan="4"><div style="height:26px; text-align:left; line-height:26px; background:url(images/xbj1.jpg) repeat-x; border:1px solid #e9f5fa;font-weight:bold;">&nbsp;&nbsp;搜索</div>
</td></tr>
<tr>
  <td align="right"><strong>标题</strong>：</td>
  <td width="300" align="left">&nbsp;<input type="text" name="title" value="<{$search.title}>"/></td>
  <td align="right"><strong>来源</strong>：</td>
  <td width="300" align="left">&nbsp;<input type="text" name="froms" value=""/></td>
</tr>
  <td width="300" align="center" colspan="4">&nbsp;<input type="submit" value="搜索"/></td>
</tr>
</tbody></table>
</form>

<table width="849" cellpadding="0" cellspacing="0" class="lefttab">
<tr><td colspan= "9"><div style="height:26px; text-align:left; line-height:26px; background:url(images/xbj1.jpg) repeat-x; border:1px solid #e9f5fa;font-weight:bold;">&nbsp;&nbsp;资讯列表</div>
</td></tr>
<tr style="background:#dceff6;" id="top">
  <td width="25"><input type="checkbox" name="" value=""></td>
  <td><strong>ID</strong></td>
  <td><strong>标题</strong></td>
  <td><strong>分类</strong></td>
  <td><strong>来源</strong></td>
  <td><strong>更新时间</strong></td>
  <td><strong>浏览次数</strong></td>
  <td><strong>操作</strong></td>
</tr>
<{if $select eq ''}> 
<{foreach item=select from=$select}>
<tr line_id="<{$select.id}>">
  <td> <input type="checkbox" name="checkbox" value="<{$select.id}>" /></td>
  <td value_id="<{$select.id}>"><{$select.id}></td>
  <td value_id="<{$select.id}>"><{$select.title}></td>
  <td value_id="<{$select.id}>"><{$select.sort}></td>
  <td value_id="<{$select.id}>"><{$select.froms}></td>
  <td value_id="<{$select.id}>"><{$select.date}></td>
   <td value_id="<{$select.id}>"><{$select.read}></td>
  <!--<td value_id="<{$select.id}>"><a href="information_check.php?id=<{$select.id}>">是否发布</a></td>-->
  <td class="f-14 td-manage"><a style="text-decoration:none" class="ml-5" onClick="article_edit('资讯编辑','information_add.php?id=<{$select.id}>','10001')" href="javascript:;" title="编辑"><i class="Hui-iconfont">编辑</i></a> <a style="text-decoration:none" class="ml-5" onClick="delSingle('<{$select.id}>','<{$_basename}>?action=del','')" href="javascript:;" title="删除"><i class="Hui-iconfont">删除</i></a></td>
</tr>
<{/foreach}>
<{else}>
<{foreach item=select from=$select}>
<tr line_id="<{$select.id}>">
  <td> <input type="checkbox" name="checkbox" value="<{$select.id}>"/></td>
  <td value_id="<{$select.id}>"><{$select.id}></td>
  <td value_id="<{$select.id}>"><{$select.title}></td>
  <td value_id="<{$select.id}>"><{$select.sort}></td>
  <td value_id="<{$select.id}>"><{$select.froms}></td>
  <td value_id="<{$select.id}>"><{$select.date}></td>
   <td value_id="<{$select.id}>"><{$select.read}></td>
  <!--<td class="td-status"><span class="label label-success radius">已发布</span></td>-->
  <td class="f-14 td-manage"><a style="text-decoration:none" class="ml-5" onClick="article_edit('资讯编辑','information_add.php?id=<{$select.id}>','10001')" href="javascript:;" title="编辑"><i class="Hui-iconfont" style="font-style:normal;color:#49649E">编辑</i></a> <a style="text-decoration:none" class="ml-5" onClick="delSingle('<{$select.id}>','<{$_basename}>?action=del','')" href="javascript:;" title="删除"><i class="Hui-iconfont" style="font-style:normal;color:#49649E">删除</i></a></td>
</tr>
<{/foreach}>
<{/if}>
<tr id="addTr">
 
</tr>
</table>
  <div class="fenye" >
    <p>&nbsp;</p>
    <p>&nbsp;&nbsp;<a onclick='allcheck()' href="javascript:void(0)">全选</a> | <a onclick='checkback()' href="javascript:void(0)">反选</a> |<a onclick="del('<{$_basename}>?action=del','')" href="javascript:void(0)">删除</a>&nbsp;&nbsp;&nbsp;&nbsp;<{$page}></p><input align="left" style="margin-right: 195px; float:right; margin-top:-10px" type="button" onclick="article_add('资讯发布','information_add.php')" name="submit" value="发布资讯" class="inp" /></p>
  </div>

</div>

<script type="text/javascript">
// $('.table-sort').dataTable({
// 	"aaSorting": [[ 1, "desc" ]],//默认第几个排序
// 	"bStateSave": true,//状态保存
// 	"aoColumnDefs": [
// 	  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
// 	  {"orderable":false,"aTargets":[0,8]}// 制定列不参与排序
// 	]
// });

/*资讯-添加*/
function article_add(title,url,w,h){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
/*资讯-编辑*/
function article_edit(title,url,id,w,h){
	var index = layer.open({
		type: 2,
		title: false,
		content: url
		
	});
	layer.full(index);
}
/*资讯-删除*/
function article_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$(obj).parents("tr").remove();
		layer.msg('已删除!',{icon:1,time:1000});
	});
}
/*资讯-审核*/
function article_shenhe(obj,id){
	layer.confirm('审核文章？', {
		btn: ['通过','不通过'], 
		shade: false
	},
	function(){
		$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_start(this,id)" href="javascript:;" title="申请上线">申请上线</a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已发布</span>');
		$(obj).remove();
		layer.msg('已发布', {icon:6,time:1000});
	},
	function(){
		$(obj).parents("tr").find(".td-manage").prepend('<a class="c-primary" onClick="article_shenqing(this,id)" href="javascript:;" title="申请上线">申请上线</a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-danger radius">未通过</span>');
		$(obj).remove();
    	layer.msg('未通过', {icon:5,time:1000});
	});	
}
/*资讯-下架*/
function test()
{
	alert("哈哈哈");
	layer.confirm('您是如何看待前端开发？', {
  btn: ['重要','奇葩'] //按钮
}, function(){
  layer.msg('的确很重要', {icon: 1});
}, function(){
  layer.msg('也可以这样', {
    time: 20000, //20s后自动关闭
    btn: ['明白了', '知道了']
  });
});

}

function article_stop(obj,id){
	
	layer.confirm('确认要下架吗？',function(index){
	
		//将一个jsObject转换成JQueryObjec
		$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="article_start(this,id)" href="javascript:;" title="发布"><i class="Hui-iconfont">已发布</i></a>');
		
		$(obj).parents("tr").find(".td-status").html('<span class="label label-defaunt radius">已下架</span>');
		$(obj).remove();
		layer.msg('已下架!',{icon: 5,time:1000});
		
	});
}

/*资讯-发布*/
function article_start(obj,id){
	layer.confirm('确认要发布吗？',function(index){
		$(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="article_stop(this,id)" href="javascript:;" title="下架"><i class="Hui-iconfont">下架</i></a>');
		$(obj).parents("tr").find(".td-status").html('<span class="label label-success radius">已发布</span>');
		$(obj).remove();
		layer.msg('已发布!',{icon: 6,time:1000});
	});
}
/*资讯-申请上线*/
function article_shenqing(obj,id){
	$(obj).parents("tr").find(".td-status").html('<span class="label label-default radius">待审核</span>');
	$(obj).parents("tr").find(".td-manage").html("");
	layer.msg('已提交申请，耐心等待审核!', {icon: 1,time:2000});
	
}

</script> 
</body>
</html>